<?php $this->load->view('layout/header');?>
<div class="supplier-content-page">
    <div class="product-test-h5">
        <?php echo breadcrumb(array('tourismgoods/grid'=>'旅游商品','tourismgoodsbargaining/grid?goods_attr_id='.$this->input->get('goods_attr_id')=>'议价')); ?>
        <div class="product-alls">
            <div class="product-view-area">
            	<p>议价</p>
            	<a href="<?php echo site_url('tourismgoodsbargaining/grid').'?goods_attr_id='.$this->input->get('goods_attr_id')?>">议价列表</a>
            </div>
            <div class="add-form">
                <form class="form-horizontal form-tourismgoodsbargaining" action="<?php echo base_url('tourismgoodsbargaining/addPost') ?>" method="post">
                    <input type="hidden" name="goods_attr_id" value="<?php echo $this->input->get('goods_attr_id');?>">
                    <input type="hidden" name="status" value="2">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">商品名称</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" readonly="readonly" value="<?php echo $tourismgoodsbase->goods_name;?>">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">商品销售价</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" name="old_price" readonly="readonly" value="<?php echo $tourismgoodsbase->shop_price;?>">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"><em>* </em>分销商</label>
                        <div class="col-xs-6">
                            <textarea type="text" rows="3" class="form-control required" name="user_name" placeholder="可以填写多个账户（如，test_fx01,test_fx）用，号隔开"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"><em>* </em>分销价</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control required number" name="shop_price" >
                        </div>
                    </div>
                    <div class="form-group">
                       <label class="col-sm-1 control-label"><em>* </em>结算方式</label>
        			   <div class="col-xs-6">
                            <label class="radio-inline">
                                <input type="radio" checked="checked" name="node" value="1">系统结算
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="node" value="2">自主结算
                            </label> 
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"><em>* </em>手续费</label>
                        <div class="col-xs-6">
                            <label class="radio-inline">
                                <input type="radio"  name="payer" value="2" checked="checked">商家支付
                            </label>
                        </div>
                    </div>
                    <div class="sup-submit">
                        <button type="submit" class="btn btn-default">保存</button>
                        <a href="<?php echo site_url('tourismgoodsbase/grid'); ?>">返回上一级</a>
                    </div>
                </form>
            </div>
        </div>
    </div>    
</div>
<script type="text/javascript">
    $('.form-tourismgoodsbargaining').submit(function(){
        return false;
    }).validate({
        submitHandler: function(f) {
            $.ajax({
                type: 'post',
                async: true,
                dataType : 'json',
                url: hostUrl()+'/tourismgoodsbargaining/ajaxValidate',
                data: $('.form-tourismgoodsbargaining').serialize(),
                success: function(data) {
                    if (data.status) {
                        window.location.href = data.msg;
                     } else {
                    	 layerMessages(data.status, data.msg);
                     }
                }
            });
        }
    });
</script>
<?php $this->load->view('layout/footer');?>
<?php $this->load->view('user/addSupplierUid/ajaxGetUser');?>